//
//#include <stdio.h>
//#include <string.h>
//#include <time.h>
//#include "NetApi.h"
//
//#include <curl/curl.h>
//void UploadFileToUrl(const char* url,const char* filename,string session)
//{
//
//	char* buf;
//	FILE* file = fopen(filename,"r");
//	fseek(file,0,SEEK_END);
//	long len = ftell(file);
//	fseek(file,0,SEEK_SET);
//	buf = new char[len];
//
//	fread(buf,len,1,file);
//	fclose(file);
//
//	CURL* curlHandle = curl_easy_init();
//	struct curl_httppost *post=NULL;
//	struct curl_httppost *last=NULL;
//	curl_formadd(&post, &last,
//		CURLFORM_COPYNAME, "file",
//		CURLFORM_BUFFER, filename,
//		CURLFORM_BUFFERPTR, buf,
//		CURLFORM_BUFFERLENGTH,len,
//		CURLFORM_END);
//	curl_formadd(&post, &last,
//		CURLFORM_COPYNAME, "Submit",
//		CURLFORM_COPYCONTENTS,"",
//		CURLFORM_END);
//	curl_formadd(&post, &last,
//		CURLFORM_COPYNAME, "action",
//		CURLFORM_COPYCONTENTS,"uppic",
//		CURLFORM_END);
//	/* Set the form info */
//	curl_easy_setopt(curlHandle,CURLOPT_URL,url);
//	curl_easy_setopt(curlHandle,   CURLOPT_POST,   1); 
//	curl_easy_setopt(curlHandle, CURLOPT_HTTPPOST, post);
//	curl_easy_setopt(curlHandle, CURLOPT_COOKIE, session.c_str());
//	curl_easy_perform(curlHandle); /* post away! */
//	/* free the post data again */
//	curl_formfree(post);
//	curl_easy_cleanup(curlHandle);
//
//	delete buf;
//	buf = NULL;
//
//}
//
//
//int main()
//{
//	CURL* conn;
//	string loginXML;
//	string session = Net_login(conn,"http://10.20.206.55:8080/online1.2/api/login?cmd=login&user=test&pass=123456",string(""),string(""),&loginXML);
//  UploadFileToUrl("http://10.20.206.55:8080/online1.2/test/testupdata?md5=6ba6666635f20cd2ec3e8b001beb41e3&parentid=A1001-ROOT","t.jpg",session);
//  return 0;
//}
